package com.example.project.controller;

import com.example.project.pojo.Bj;
import com.example.project.pojo.Zong;
import com.example.project.service.ZongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

@RestController
public class ZongContrlooer {
    @Autowired
    ZongService zongService;

    @RequestMapping("/selectByCid")
    public String selectByCid(int cid, HttpSession session){
        List<Zong> zong = zongService.selectByCid(cid);
        session.setAttribute("zong",zong);
        return zong.toString();
    }
}
